<?php

namespace app\Controller;

class Controller
{
    public $data = [];

    public function assign($key, $value)
    {
        $this->data[$key] = $value;
    }
    public function display($value = '')
    {
        $action = (empty($value)) ? $_ENV['action'] : $value;
        extract($this->data);
        ob_start();
        include_once ROOT_PATH . "app/view/{$_ENV['controller']}/$action.php";
        $html = ob_get_clean();
        echo $html;
    }
}
